﻿@model S4Store.Models.Inventory.AgedIndexModel
@{
    Layout = null;
    ViewBag.Title = "CarBrandInventory";
}
<div style="height:100%; overflow:auto">
@Html.Action("ReportBar", "Common", Model.BarModel)


@if (Model.Reports.Sum(t => t.CKC) == 0)
{
    <div style="margin:20px; text-align:center">
    暂无60天以上高龄库存
    </div>
}
else
{
<div style="margin:20px; text-align:center">
    60天以上高龄库存
</div>
 <table  style="border-collapse:collapse; width:100%" class="reporttable">
 
 <tr>
  <th rowspan="2">车型</th>
  <th rowspan="2">车款</th>
  <th colspan="2">库存</th>
 </tr>
 <tr>
  <th>C类</th>
  <th>C类库龄</th>
 </tr>
   @for (var i = 0; i < Model.CarBrands.Count; i++)
   {
       var brand = Model.CarBrands[i];
       var carmodelreports = Model.GetCarModelReports(brand);
       for (int j = 0; j < carmodelreports.Count; j++)
       {
           var r = carmodelreports[j];
 <tr>
    @if (j == 0)
    {
   <td rowspan="@carmodelreports.Count">@brand.Name</td>
    }
    <td>@r.CarModel.Name</td> 
    <td>@r.CKC</td>  
    <td>@r.CKL</td>   
 </tr>
       }
   }
   <tr>
    <td colspan="2">库存合计</td>
    <td>@Model.Reports.Sum(t => t.CKC)</td>
    <td></td>   
   </tr>
 </table>
}
</div>
